<?php
session_start();
if(!$_SESSION["trv3_07"]){
	header("location:../login.php");
	exit;
}
require "../resources/v1.php";
if( !get_magic_quotes_gpc()){
	$XCC01 = addslashes( trim( $_GET['val1']));
	isset( $_GET['val2']) ? $XCC02 = addslashes(trim( $_GET['val2'])) : $XCC02 = "0";
}else{
    $XCC01 = trim( $_GET['val1']);
	isset( $_GET['val2']) ? $XCC02 = trim( $_GET['val2']) : $XCC02 = "0";
} 
if( $XCC02){
	$conexion = server_reconnect();
	$query = "select i.`id`,i.`ape`,i.`nom`,i.`dom`,i.`edad`,i.`sex` from `inf` i where i.`td`=".$XCC01." and i.`nro`=".$XCC02;
	$result = mysql_query( $query, $conexion);
	echo '<?xml version="1.0" encoding="UTF-8"?><input>';
	if( $mxcel = @mysql_fetch_array($result)){
		echo '<CC03>'.$mxcel['ape'].'</CC03>';
		echo '<CC04>'.$mxcel['nom'].'</CC04>';
		echo '<CC05>'.$mxcel['dom'].'</CC05>';
		echo '<CC06>'.$mxcel['edad'].'</CC06>';
		echo '<CC07>'.$mxcel['sex'].'</CC07>';
		echo '<HD10>'.$mxcel['id'].'</HD10></input>';
	}else{
		
		/*
			Aqui debe buscarlo en la base de contravencion. Si lo encuentra lo recupera y sino carga vacios en los datos
		
		*/
		
		echo '<CC03> </CC03><CC04> </CC04><CC05> </CC05><CC06> </CC06><CC07>0</CC07><HD10>0</HD10></input>';
	}
	server_disconnect( $conexion);
}
?>